package edu.sctu.practice.class01.wulixia.month09_wlx.test02;

/**
 * Created by wulixia on 2015/10/14.
 */
public class Vehicle {
    private double speed;
    private double size;

    public Vehicle(double speed, double size) {
        this.speed = speed;
        this.size = size;
    }

    public void move(){
        System.out.println("一辆大小为：" + size +"吨的轿车，正安全地行驶在路上。参与速度测试。");
    }

    public void speedUp(int speedup){
        speed = speed + speedup;
        System.out.println("目前速度为：" + speed + "千米每小时");
        if(speed > 90){
            System.out.println("超速，请减速。");
        }
    }

    public void speedDown(int speeddown){
        speed = speed + speeddown;
        System.out.println("目前速度为:" + speed + "千米每小时");
    }
}
